home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cocktail / reuse.lha / reuse / src / Source.md < prev    next >
Text File  |  1992-08-18  |  1KB  |  42 lines

  1. (* $Id: Source.md,v 1.0 1992/08/07 14:42:02 grosch rel $ *)
  2.  
  3. (* $Log: Source.md,v $
  4. # Revision 1.0  1992/08/07  14:42:02  grosch
  5. # Initial revision
  6. #
  7.  *)
  8.  
  9. (* Ich, Doktor Josef Grosch, Informatiker, Juli 1992 *)
  10.  
  11. DEFINITION MODULE Source;
  12.  
  13. FROM SYSTEM    IMPORT ADDRESS;
  14. FROM System    IMPORT tFile;
  15.  
  16. PROCEDURE BeginSource (FileName: ARRAY OF CHAR): tFile;
  17.  
  18.    (*
  19.       BeginSource is called from the scanner to open files.
  20.       If not called then input is read form standard input.
  21.    *)
  22.  
  23. PROCEDURE GetLine (File: tFile; Buffer: ADDRESS; Size: CARDINAL): INTEGER;
  24.  
  25.    (*
  26.       GetLine is called to fill a buffer starting at address 'Buffer'
  27.       with a block of maximal 'Size' characters. Lines are terminated
  28.       by newline characters (ASCII = 0xa). GetLine returns the number
  29.       of characters transferred. Reasonable block sizes are between 128
  30.       and 2048 or the length of a line. Smaller block sizes -
  31.       especially block size 1 - will drastically slow down the scanner.
  32.    *)
  33.  
  34. PROCEDURE CloseSource (File: tFile);
  35.  
  36.    (*
  37.       CloseSource is called from the scanner at end of file or
  38.       at end of input, respectively. It can be used to close files.
  39.    *)
  40.  
  41. END Source.
  42.